{extend name="public:base" /}
{block name="title"}会员首页{/block}

{block name="content"}
    <section class="content">

      <div class="box box-solid">
        <div class="box-header with-border">
          <h3 class="box-title">订单支付</h3>
        </div>
        <!-- /.box-header -->
        <!-- form start -->
        <form class="form-horizontal" id="operate">
          <div class="box-body">
            <div class="form-group">
              <label class="col-sm-2 control-label">商品名称</label>

              <div class="col-sm-10">
                <input type="text" readonly class="form-control" name="title" value="{$title}">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">订单金额</label>

              <div class="col-sm-10">
                <input type="text" readonly class="form-control" name="price" value="{$price}">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">支付方式</label>
              <div class="col-sm-10">
                <div class="radio">
                  <label>
                    <input type="radio" checked id="payment_type" name="payment_type" value="1" >支付宝
                  </label>
                  <!--
                  <label>
                    <input type="radio" id="payment_type" name="payment_type" value="2" >微信
                  </label>
                  -->
                </div>
              </div>
            </div>
          </div>
          <!-- /.box-body -->
          <div class="box-footer">
            <input type="hidden" class="form-control" id="id" name="id" value="{$id}">
            <button type="button" onclick="operate();" class="btn btn-default">付款</button>
          </div>
          <!-- /.box-footer -->
          <div id="pay"></div>
        </form>
      </div>

    </section>
{/block}

{block name="js"}
<script type="text/javascript">
    function operate(){
        var id = $("#id").val();
        var payment_type = $('input[name="payment_type"]:checked').val();
        window.location.href = "{:url('member/order/pay')}" + "?id=" + id + "&payment_type=" + payment_type;
    }
</script>
{/block}